import json
import os
from openpyxl import load_workbook
import pandas as pd
from tqdm import tqdm
from basic_component_related_management.models import *

# 创建一个superadmin，密码是superadmin1234
user_entity = User.objects.filter(user_account="superadmin").first()
if user_entity is None:
    user_entity = User.objects.create(
        user_account="superadmin",
        user_name="superadmin",
        password="C6IDQGUT42vVUX0neDCF2TB2kD42tBWwp4AGqp3DenmkTYI9urFbhJomuOMcI25De98AjQJPBT07AUW5oQdYeHfeQKr/uhR6OABnKu+/uof5viBguKPdDqkc/znPMjADdt66dxVi/yeur8EahDaUCvhssdB4HkJLxteCLGlEDZ/AJe1BiTBCgyN+7ZLCEjxXD4lKbI5mT9oWEQ+Pd1rE7fY/jmuDh6Nnz2YO7/0WvQA39KESBVzrVQ5bmEVSnUNkQqfzR8DkylHQ54swmNGXFog9xd7q0gjd2VrsBfE6qD4y+iJThQlALLh1f9QdVthAcuepLUKW+PI/mmyllQTufw=="
    )



def init_property_dataV1():
    data_file = "files/property_dataV1/0. 数据字典-物性列表20241220R3.xlsx"
    sheet_name1 = "1-物性总表"
    df1 = pd.read_excel(data_file, sheet_name=sheet_name1, dtype=str)
    df1 = df1.fillna("")
    df1 = df1.iloc[2:, :14]
    print(df1.head())

    
    pass